import request from '@/utils/request'

export function getEmployeesSimples(){
    return request({
        url:'sys/user/simple'
    })
}

export function getEmployees(page,size) {
    return request({
      url: '/sys/user',
      params: {page:page, size:size}
    })
  }

  export function addEmployee(data){
    return request({
      method:'post',
      url:'/sys/user',
      data
    })
  }

  //删除员工
  export function delEmployee(id){
    return request({
      method:'delete',
      url:`/sys/user/${id}`,
    })
  }

  // 批量添加

  export function addEmployeeBatch(data){
    return request({
      method:'post',
      url:`/sys/user/batch`,
      data
    })
  }

  // 保存员工信息
  export function saveUserDetailById(data){
    return request({
      method:'put', //全量修改
      url:`/sys/user/${data.id}`,
      data
    })
  }

  // 分配
  export function assignRoles(data){
    return request({
      url:'/sys/user/assignRoles',
      data,
      method:'put'
    })
  }